<template>
  <div class="dashboard-container">
    <div class="dashboard-text">name: {{ name }}</div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
  name: 'Dashboard',
  computed: {
    ...mapGetters(['name'])
  }
  // async created() {
  //   console.log(1)
  //   // 发送请求获取用户数据, 这里发送请求时异步会导致页面加载有些地方拿不到数据
  //   // 所以将请求放到点击登录时发送
  //   await this.$store.dispatch('user/setUserInfoActions')
  // }
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
